<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    <title>负熵为生  | Maven之私服搭建</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1">
    <meta name="generator" content="Hugo 0.81.0" />
    
    
      <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
    

    
    
      <link href="/dist/css/app.1cb140d8ba31d5b2f1114537dd04802a.css" rel="stylesheet">
    

    

    
      
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

    

    
    
    <meta property="og:title" content="Maven之私服搭建" />
<meta property="og:description" content="安装 前置
# Linux CentOS 7 $ cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core) # Java OpenJDK 8 $ yum install java-1.8.0-openjdk-devel $ java -version openjdk version &quot;1.8.0_242&quot; OpenJDK Runtime Environment (build 1.8.0_242-b08) OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode) 安装
# https://help.sonatype.com/repomanager2/download # 注意：国内网络可能无法下载，考虑科学上网，或者从其它网站下载 $ curl -OL https://download.sonatype.com/nexus/oss/nexus-latest-bundle.tar.gz # https://help.sonatype.com/repomanager2/installing-and-running $ tar zxvf nexus-2.14.16-01-bundle.tar.gz -C /opt # /opt/nexus-2.14.16-01 Nexus服务程序目录 # /opt/sonatype-work 数据（构件）存放目录 # 创建 nexus 用户，因为 Nexus 不推荐使用 root 用户运行服务 # 注：不能是禁止登录无home目录的虚用户（程序使用 su 切换用户） $ useradd nexus # 修改目录拥有者属性，因为后面将使用 nexus 用户来运行服务 $ chown nexus:nexus -R /opt/nexus-2." />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://zlikun.gitee.io/post/java/maven%E4%B9%8B%E7%A7%81%E6%9C%8D%E6%90%AD%E5%BB%BA/" /><meta property="article:section" content="post" />
<meta property="article:published_time" content="2020-03-18T13:24:12&#43;08:00" />
<meta property="article:modified_time" content="2020-03-18T13:24:12&#43;08:00" />

<meta itemprop="name" content="Maven之私服搭建">
<meta itemprop="description" content="安装 前置
# Linux CentOS 7 $ cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core) # Java OpenJDK 8 $ yum install java-1.8.0-openjdk-devel $ java -version openjdk version &quot;1.8.0_242&quot; OpenJDK Runtime Environment (build 1.8.0_242-b08) OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode) 安装
# https://help.sonatype.com/repomanager2/download # 注意：国内网络可能无法下载，考虑科学上网，或者从其它网站下载 $ curl -OL https://download.sonatype.com/nexus/oss/nexus-latest-bundle.tar.gz # https://help.sonatype.com/repomanager2/installing-and-running $ tar zxvf nexus-2.14.16-01-bundle.tar.gz -C /opt # /opt/nexus-2.14.16-01 Nexus服务程序目录 # /opt/sonatype-work 数据（构件）存放目录 # 创建 nexus 用户，因为 Nexus 不推荐使用 root 用户运行服务 # 注：不能是禁止登录无home目录的虚用户（程序使用 su 切换用户） $ useradd nexus # 修改目录拥有者属性，因为后面将使用 nexus 用户来运行服务 $ chown nexus:nexus -R /opt/nexus-2."><meta itemprop="datePublished" content="2020-03-18T13:24:12&#43;08:00" />
<meta itemprop="dateModified" content="2020-03-18T13:24:12&#43;08:00" />
<meta itemprop="wordCount" content="408">
<meta itemprop="keywords" content="Maven,Gradle,Nexus,DevOps," /><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Maven之私服搭建"/>
<meta name="twitter:description" content="安装 前置
# Linux CentOS 7 $ cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core) # Java OpenJDK 8 $ yum install java-1.8.0-openjdk-devel $ java -version openjdk version &quot;1.8.0_242&quot; OpenJDK Runtime Environment (build 1.8.0_242-b08) OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode) 安装
# https://help.sonatype.com/repomanager2/download # 注意：国内网络可能无法下载，考虑科学上网，或者从其它网站下载 $ curl -OL https://download.sonatype.com/nexus/oss/nexus-latest-bundle.tar.gz # https://help.sonatype.com/repomanager2/installing-and-running $ tar zxvf nexus-2.14.16-01-bundle.tar.gz -C /opt # /opt/nexus-2.14.16-01 Nexus服务程序目录 # /opt/sonatype-work 数据（构件）存放目录 # 创建 nexus 用户，因为 Nexus 不推荐使用 root 用户运行服务 # 注：不能是禁止登录无home目录的虚用户（程序使用 su 切换用户） $ useradd nexus # 修改目录拥有者属性，因为后面将使用 nexus 用户来运行服务 $ chown nexus:nexus -R /opt/nexus-2."/>

  </head>

  <body class="ma0 avenir bg-near-white">

    
   
  

  <header>
    <div class="bg-black">
      <nav class="pv3 ph3 ph4-ns" role="navigation">
  <div class="flex-l justify-between items-center center">
    <a href="https://zlikun.gitee.io/" class="f3 fw2 hover-white no-underline white-90 dib">
      负熵为生
    </a>
    <div class="flex-l items-center">
      

      
      




<a href="https://twitter.com/zlikun" target="_blank" class="link-transition twitter link dib z-999 pt3 pt0-l mr1" title="Twitter link" rel="noopener" aria-label="follow on Twitter——Opens in a new window">
  <svg height="32px"  style="enable-background:new 0 0 67 67;" version="1.1" viewBox="0 0 67 67" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M37.167,22.283c-2.619,0.953-4.274,3.411-4.086,6.101  l0.063,1.038l-1.048-0.127c-3.813-0.487-7.145-2.139-9.974-4.915l-1.383-1.377l-0.356,1.017c-0.754,2.267-0.272,4.661,1.299,6.271  c0.838,0.89,0.649,1.017-0.796,0.487c-0.503-0.169-0.943-0.296-0.985-0.233c-0.146,0.149,0.356,2.076,0.754,2.839  c0.545,1.06,1.655,2.097,2.871,2.712l1.027,0.487l-1.215,0.021c-1.173,0-1.215,0.021-1.089,0.467  c0.419,1.377,2.074,2.839,3.918,3.475l1.299,0.444l-1.131,0.678c-1.676,0.976-3.646,1.526-5.616,1.568  C19.775,43.256,19,43.341,19,43.405c0,0.211,2.557,1.397,4.044,1.864c4.463,1.377,9.765,0.783,13.746-1.568  c2.829-1.673,5.657-5,6.978-8.221c0.713-1.716,1.425-4.851,1.425-6.354c0-0.975,0.063-1.102,1.236-2.267  c0.692-0.678,1.341-1.419,1.467-1.631c0.21-0.403,0.188-0.403-0.88-0.043c-1.781,0.636-2.033,0.551-1.152-0.402  c0.649-0.678,1.425-1.907,1.425-2.267c0-0.063-0.314,0.042-0.671,0.233c-0.377,0.212-1.215,0.53-1.844,0.72l-1.131,0.361l-1.027-0.7  c-0.566-0.381-1.361-0.805-1.781-0.932C39.766,21.902,38.131,21.944,37.167,22.283z M33,64C16.432,64,3,50.569,3,34S16.432,4,33,4  s30,13.431,30,30S49.568,64,33,64z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/></svg>

<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000" width="8px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/>
</svg>
</span></a>





<a href="https://github.com/zlikun" target="_blank" class="link-transition github link dib z-999 pt3 pt0-l mr1" title="Github link" rel="noopener" aria-label="follow on Github——Opens in a new window">
  <svg  height="32px"  style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
  <path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1   c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14   c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5   c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7   c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3   c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7   C480,134.8,379.7,32,256,32z"/>
</svg>

<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000" width="8px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/>
</svg>
</span></a>







    </div>
  </div>
</nav>

    </div>
  </header>



    <main class="pb7" role="main">
      
  
  <article class="flex-l flex-wrap justify-between mw8 center ph3">
    <header class="mt4 w-100">
      <aside class="instapaper_ignoref b helvetica tracked">
          
        POSTS
      </aside>
      




  <div id="sharing" class="mt3">

    
    <a href="https://www.facebook.com/sharer.php?u=https://zlikun.gitee.io/post/java/maven%E4%B9%8B%E7%A7%81%E6%9C%8D%E6%90%AD%E5%BB%BA/" class="facebook no-underline" aria-label="share on Facebook">
      <svg height="32px"  style="enable-background:new 0 0 67 67;" version="1.1" viewBox="0 0 67 67" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M28.765,50.32h6.744V33.998h4.499l0.596-5.624h-5.095  l0.007-2.816c0-1.466,0.14-2.253,2.244-2.253h2.812V17.68h-4.5c-5.405,0-7.307,2.729-7.307,7.317v3.377h-3.369v5.625h3.369V50.32z   M33,64C16.432,64,3,50.569,3,34S16.432,4,33,4s30,13.431,30,30S49.568,64,33,64z" style="fill-rule:evenodd;clip-rule:evenodd;"/></svg>

    </a>

    
    
    <a href="https://twitter.com/share?url=https://zlikun.gitee.io/post/java/maven%E4%B9%8B%E7%A7%81%E6%9C%8D%E6%90%AD%E5%BB%BA/&amp;text=Maven%e4%b9%8b%e7%a7%81%e6%9c%8d%e6%90%ad%e5%bb%ba" class="twitter no-underline" aria-label="share on Twitter">
      <svg height="32px"  style="enable-background:new 0 0 67 67;" version="1.1" viewBox="0 0 67 67" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M37.167,22.283c-2.619,0.953-4.274,3.411-4.086,6.101  l0.063,1.038l-1.048-0.127c-3.813-0.487-7.145-2.139-9.974-4.915l-1.383-1.377l-0.356,1.017c-0.754,2.267-0.272,4.661,1.299,6.271  c0.838,0.89,0.649,1.017-0.796,0.487c-0.503-0.169-0.943-0.296-0.985-0.233c-0.146,0.149,0.356,2.076,0.754,2.839  c0.545,1.06,1.655,2.097,2.871,2.712l1.027,0.487l-1.215,0.021c-1.173,0-1.215,0.021-1.089,0.467  c0.419,1.377,2.074,2.839,3.918,3.475l1.299,0.444l-1.131,0.678c-1.676,0.976-3.646,1.526-5.616,1.568  C19.775,43.256,19,43.341,19,43.405c0,0.211,2.557,1.397,4.044,1.864c4.463,1.377,9.765,0.783,13.746-1.568  c2.829-1.673,5.657-5,6.978-8.221c0.713-1.716,1.425-4.851,1.425-6.354c0-0.975,0.063-1.102,1.236-2.267  c0.692-0.678,1.341-1.419,1.467-1.631c0.21-0.403,0.188-0.403-0.88-0.043c-1.781,0.636-2.033,0.551-1.152-0.402  c0.649-0.678,1.425-1.907,1.425-2.267c0-0.063-0.314,0.042-0.671,0.233c-0.377,0.212-1.215,0.53-1.844,0.72l-1.131,0.361l-1.027-0.7  c-0.566-0.381-1.361-0.805-1.781-0.932C39.766,21.902,38.131,21.944,37.167,22.283z M33,64C16.432,64,3,50.569,3,34S16.432,4,33,4  s30,13.431,30,30S49.568,64,33,64z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/></svg>

    </a>

    
    <a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=https://zlikun.gitee.io/post/java/maven%E4%B9%8B%E7%A7%81%E6%9C%8D%E6%90%AD%E5%BB%BA/&amp;title=Maven%e4%b9%8b%e7%a7%81%e6%9c%8d%e6%90%ad%e5%bb%ba" class="linkedin no-underline" aria-label="share on LinkedIn">
      <svg  height="32px"  style="enable-background:new 0 0 65 65;" version="1.1" viewBox="0 0 65 65" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <path d="M50.837,48.137V36.425c0-6.275-3.35-9.195-7.816-9.195  c-3.604,0-5.219,1.983-6.119,3.374V27.71h-6.79c0.09,1.917,0,20.427,0,20.427h6.79V36.729c0-0.609,0.044-1.219,0.224-1.655  c0.49-1.22,1.607-2.483,3.482-2.483c2.458,0,3.44,1.873,3.44,4.618v10.929H50.837z M22.959,24.922c2.367,0,3.842-1.57,3.842-3.531  c-0.044-2.003-1.475-3.528-3.797-3.528s-3.841,1.524-3.841,3.528c0,1.961,1.474,3.531,3.753,3.531H22.959z M34,64  C17.432,64,4,50.568,4,34C4,17.431,17.432,4,34,4s30,13.431,30,30C64,50.568,50.568,64,34,64z M26.354,48.137V27.71h-6.789v20.427  H26.354z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/>
</svg>

    </a>
  </div>

      <h1 class="f1 athelas mt3 mb1">Maven之私服搭建</h1>
      
      
      <time class="f6 mv4 dib tracked" datetime="2020-03-18T13:24:12&#43;08:00">March 18, 2020</time>

      
      
    </header>
    <div class="nested-copy-line-height lh-copy serif f4 nested-links nested-img mid-gray pr4-l w-two-thirds-l"><h3 id="安装">安装</h3>
<p><strong>前置</strong></p>
<pre><code># Linux CentOS 7
$ cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)

# Java  OpenJDK 8
$ yum install java-1.8.0-openjdk-devel
$ java -version
openjdk version &quot;1.8.0_242&quot;
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
</code></pre><p><strong>安装</strong></p>
<pre><code># https://help.sonatype.com/repomanager2/download
# 注意：国内网络可能无法下载，考虑科学上网，或者从其它网站下载
$ curl -OL https://download.sonatype.com/nexus/oss/nexus-latest-bundle.tar.gz

# https://help.sonatype.com/repomanager2/installing-and-running
$ tar zxvf nexus-2.14.16-01-bundle.tar.gz -C /opt

# /opt/nexus-2.14.16-01  Nexus服务程序目录
# /opt/sonatype-work     数据（构件）存放目录

# 创建 nexus 用户，因为 Nexus 不推荐使用 root 用户运行服务
# 注：不能是禁止登录无home目录的虚用户（程序使用 su 切换用户）
$ useradd nexus

# 修改目录拥有者属性，因为后面将使用 nexus 用户来运行服务
$ chown nexus:nexus -R /opt/nexus-2.14.16-01
$ chown nexus:nexus -R /opt/sonatype-work

# 启动服务，默认端口 8081、context-path 为 /nexus，可通过修改配置文件改变
# 本案例中不修改，因为后面会用 Nginx 反向代理
# vi /opt/nexus-2.14.16-01/conf/nexus.properties
# 可以通过环境变量 $RUN_AS_USER 指定运行用户，也可以在启动脚本中直接设置
# vi /opt/nexus-2.14.16-01/bin/nexus
# 本案例中不设置，后面会实现 systemd 服务脚本，脚本中会设置
# 使用前台模式运行（输出消息至控制台）Nexus服务
$ export RUN_AS_USER=nexus; /opt/nexus-2.14.16-01/bin/nexus console
# 启动服务
$ export RUN_AS_USER=nexus; /opt/nexus-2.14.16-01/bin/nexus start
# 停止服务
$ export RUN_AS_USER=nexus; /opt/nexus-2.14.16-01/bin/nexus stop

# 尝试在浏览器中访问测试服务是否安装成功
# http://&lt;server_host&gt;:8081/nexus

# 首次安装后需要做一些设置（非必要，按需来即可）
# https://help.sonatype.com/repomanager2/installing-and-running/post-install-checklist
</code></pre><p><strong>服务</strong><br>
编写 <code>systemd</code> 服务脚本，将 <code>Nexus</code> 配置为系统服务，以通过 <code>systemd</code> 来管理</p>
<pre><code># /etc/systemd/system/nexus.service
[Unit]
Description=nexus service
After=network.target
  
[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus-2.14.16-01/bin/nexus start
ExecStop=/opt/nexus-2.14.16-01/bin/nexus stop
User=nexus
Restart=on-abort
  
[Install]
WantedBy=multi-user.target
</code></pre><p><strong>测试</strong></p>
<pre><code>$ systemctl daemon-reload
$ systemctl start nexus.service
$ systemctl status nexus.service
$ systemctl enable nexus.service

# 访问，注：使用独立域名，所以需要设置 context-path = / 以方便使用Nginx反向代理
# http://nexus.i.zlikun.com/
</code></pre><h3 id="反代httpshelpsonatypecomrepomanager2installing-and-runningrunning-behind-a-reverse-proxy"><a href="https://help.sonatype.com/repomanager2/installing-and-running/running-behind-a-reverse-proxy">反代</a></h3>
<p>以 <code>nexus.i.zlikun.com</code> 域名为例来配置，一般如果只是内网用只需要配置 <code>http</code> 即可，外网可访问如果配置 <code>https</code> 那么 <code>http</code> 应直接重定向到 <code>https</code> 上</p>
<pre><code class="language-conf" data-lang="conf"># nexus.i.zlikun.com.conf
server {
    listen       80;
    server_name  nexus.i.zlikun.com;

    # allow large uploads of files - refer to nginx documentation
    client_max_body_size 1G;

    location / {
        proxy_pass          http://192.168.1.101:8081/;
        proxy_set_header    Host $host;
        proxy_set_header    X-Real-IP $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

server {
    listen       443 ssl http2 default_server;
    listen       [::]:443 ssl http2 default_server;
    server_name  nexus.i.zlikun.com;

    # allow large uploads of files - refer to nginx documentation
    client_max_body_size 1G;

    ssl on;
    ssl_certificate         nexus.i.zlikun.com.pem;
    ssl_certificate_key     nexus.i.zlikun.com.key;

    location / {
        proxy_pass          http://192.168.1.101:8081/;
        proxy_set_header    Host $host;
        proxy_set_header    X-Real-IP $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Proto https;
    }
}
</code></pre><h3 id="配置">配置</h3>
<p>修改管理员密码和部署密码</p>
<pre><code># 浏览器访问 Nexus ，并使用原帐号/密码登录，在右上角的下拉菜单中修改密码即可
# 下面的 admin 和 deployment 是系统内置的两个帐号
# admin:admin123
# deployment:deployment123
</code></pre><p>代理仓库</p>
<pre><code># 仓库类型
group       仓库组，聚合多个仓库
hosted      宿主仓库（本地）
proxy       代理仓库（远程）
virtual     虚拟仓库，用于兼容 Central M1版本构件（几乎不用）

# 阿里云公共仓库
# https://maven.aliyun.com/mvn/view

# 添加 Aliyun 公共仓库（Proxy）
# https://maven.aliyun.com/repository/public/
# 在 Public Repositories 中添加 aliyun 仓库
# http://nexus.i.zlikun.com/content/groups/public/
</code></pre><h3 id="备份">备份</h3>
<p>除了公共构件外，私服中还包含一些 <code>thirdparty</code>、<code>snapshots</code>、<code>releases</code> 仓库构件，这些是公司内部开发的一些构件，公网上不存在，所以是需要备份的，避免 <code>Nexus</code> 服务数据损坏时，造成构件丢失情况</p>
<pre><code># 构件最终存储在 /opt/sonatype-work/nexus/storage 目录下的子目录（仓库ID）中
# 每个仓库对应一个目录，选择相应的仓库目录进行备份
# -a 归档模式，以递归方式传输文件，并保持文件的所有属性（rsync通过比较文件大小、最后修改时间来进行增量同步）
# -r 对子目录以递归模式处理
# -z 备份文件在传输时进行压缩处理
# -v 详细输出日志
# -S 对稀疏文件进行特殊处理以节省DST的空间
# -P 保留因故未完全传输的文件，以加快后续的再次传输（断点续传）
$ rsync -arzvSP &lt;src_path&gt; &lt;dest_path&gt;

$ rsync -arzvSP /opt/sonatype-work/nexus/storage/releases/ /data/backup/releases
$ rsync -arzvSP /opt/sonatype-work/nexus/storage/snapshots/ /data/backup/snapshots

# 生产环境将备份命令编写成 shell 脚本，通过 crontab 任务来定时执行
# 另外生产环境备份不会备份在本机，rsync 命令支持将文件备份到其它服务器（也可以是将其它服务器文件备份到本机）
# 具体 rsync 的用法请查阅相关资料自行了解
</code></pre><h3 id="ansible">Ansible</h3>
<p>最终 <code>Nexus</code> 在生产环境的安装配置应使用脚本或者 <code>Ansible</code> 等来实现，这里后续补充</p>
<pre><code>TODO
</code></pre><ul class="pa0">
  
   <li class="list">
     <a href="/tags/maven" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">Maven</a>
   </li>
  
   <li class="list">
     <a href="/tags/gradle" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">Gradle</a>
   </li>
  
   <li class="list">
     <a href="/tags/nexus" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">Nexus</a>
   </li>
  
   <li class="list">
     <a href="/tags/devops" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">DevOps</a>
   </li>
  
</ul>
<div class="mt6 instapaper_ignoref">
      
      
      </div>
    </div>

    <aside class="w-30-l mt6-l">




</aside>

  </article>

    </main>
    <footer class="bg-black bottom-0 w-100 pa3" role="contentinfo">
  <div class="flex justify-between">
  <a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="https://zlikun.gitee.io/" >
    &copy;  负熵为生 2021 
  </a>
    <div>




<a href="https://twitter.com/zlikun" target="_blank" class="link-transition twitter link dib z-999 pt3 pt0-l mr1" title="Twitter link" rel="noopener" aria-label="follow on Twitter——Opens in a new window">
  <svg height="32px"  style="enable-background:new 0 0 67 67;" version="1.1" viewBox="0 0 67 67" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M37.167,22.283c-2.619,0.953-4.274,3.411-4.086,6.101  l0.063,1.038l-1.048-0.127c-3.813-0.487-7.145-2.139-9.974-4.915l-1.383-1.377l-0.356,1.017c-0.754,2.267-0.272,4.661,1.299,6.271  c0.838,0.89,0.649,1.017-0.796,0.487c-0.503-0.169-0.943-0.296-0.985-0.233c-0.146,0.149,0.356,2.076,0.754,2.839  c0.545,1.06,1.655,2.097,2.871,2.712l1.027,0.487l-1.215,0.021c-1.173,0-1.215,0.021-1.089,0.467  c0.419,1.377,2.074,2.839,3.918,3.475l1.299,0.444l-1.131,0.678c-1.676,0.976-3.646,1.526-5.616,1.568  C19.775,43.256,19,43.341,19,43.405c0,0.211,2.557,1.397,4.044,1.864c4.463,1.377,9.765,0.783,13.746-1.568  c2.829-1.673,5.657-5,6.978-8.221c0.713-1.716,1.425-4.851,1.425-6.354c0-0.975,0.063-1.102,1.236-2.267  c0.692-0.678,1.341-1.419,1.467-1.631c0.21-0.403,0.188-0.403-0.88-0.043c-1.781,0.636-2.033,0.551-1.152-0.402  c0.649-0.678,1.425-1.907,1.425-2.267c0-0.063-0.314,0.042-0.671,0.233c-0.377,0.212-1.215,0.53-1.844,0.72l-1.131,0.361l-1.027-0.7  c-0.566-0.381-1.361-0.805-1.781-0.932C39.766,21.902,38.131,21.944,37.167,22.283z M33,64C16.432,64,3,50.569,3,34S16.432,4,33,4  s30,13.431,30,30S49.568,64,33,64z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/></svg>

<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000" width="8px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/>
</svg>
</span></a>





<a href="https://github.com/zlikun" target="_blank" class="link-transition github link dib z-999 pt3 pt0-l mr1" title="Github link" rel="noopener" aria-label="follow on Github——Opens in a new window">
  <svg  height="32px"  style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
  <path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1   c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14   c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5   c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7   c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3   c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7   C480,134.8,379.7,32,256,32z"/>
</svg>

<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000" width="8px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/>
</svg>
</span></a>






</div>
  </div>
</footer>

    

  <script src="/dist/js/app.3fc0f988d21662902933.js"></script>


  </body>
</html>
